package com.kly.user.enums;

import java.util.Objects;

/**
 * 相册类型: 1 个人照片、2 公开相册、3 私密相册
 * @author linqu
 */
public enum AlbumsType {

    PERSONAL_ALBUMS(1, "Personal albums", "个人照片"),

    PUBLIC_ALBUMS(2, "Public albums", "公开相册"),

    PRIVATE_ALBUMS(3, "Private albums", "私密相册"),



    ;

    private final int type;

    private final String Value;

    private final String description;


    AlbumsType(int type, String value, String description) {
        this.type = type;
        Value = value;
        this.description = description;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public String getDescription() {
        return description;
    }


    public static AlbumsType fromType(Integer type) {
        if (Objects.isNull(type)) {
            return null;
        }
        for (AlbumsType userStatus : values()) {
            if (userStatus.getType() == type) {
                return userStatus;
            }
        }
        return null;
    }
}
